package com.ask.exceptionDemo.demo1;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ExceptionTest1 {

    public static void main(String[] args) {
        try {
            test1();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    static void test1() throws Exception {
        // 处理异常
        SimpleDateFormat sdf =
                new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date d = sdf.parse("2028-11-11 10:24:");
        System.out.println(d);
        test2();
    }

    static void test2() throws Exception {
        // 处理异常
        InputStream is = new FileInputStream("D:/meinv.png");
    }
}
